Skip to content

Wire up organization client endpoints into OrganizationsClientsSection#324

Merged
danielabbatt merged 2 commits intomainfrom
copilot/add-search-functionality-for-clients
Apr 12, 2026
Merged

Wire up organization client endpoints into OrganizationsClientsSection#324
danielabbatt merged 2 commits intomainfrom
copilot/add-search-functionality-for-clients

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

IOrganizationsClientOverview and IOrganizationBandwidthUsageHistory interfaces existed but were never wired into MerakiClient or OrganizationsSection. The IOrganizationsClients (search) was wired as a flat interface rather than a proper section.

Changes

  • New OrganizationsClientsSection — Groups all three client interfaces following the NetworksClientsSection pattern. Uses [RefitPromoteCalls] on the internal IOrganizationsClients for backward compatibility.
  • OrganizationsSection.Clients — Changed from IOrganizationsClients to OrganizationsClientsSection
  • MerakiClient wiring — Wires up Clients, BandwidthUsageHistory, and Overview

Existing consumer code is unaffected:

// Still works — promoted via source generator
client.Organizations.Clients.GetOrganizationClientsSearchAsync(orgId, mac);

// Now also available
client.Organizations.Clients.Overview.GetOrganizationClientsOverviewAsync(orgId, t0, t1);
client.Organizations.Clients.BandwidthUsageHistory.GetOrganizationClientsBandwidthUsageHistoryAsync(orgId, t0, t1);

Copilot AI linked an issue Apr 4, 2026 that may be closed by this pull request
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 4, 2026

Not up to standards ⛔

🔴 Issues 1 minor

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
CodeStyle 1 minor

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes. Give us feedback

…tory endpoints

Create OrganizationsClientsSection to properly group all organization-client
interfaces (IOrganizationsClients, IOrganizationsClientOverview, and
IOrganizationBandwidthUsageHistory) following the established section pattern.

- Add OrganizationsClientsSection.cs with RefitPromoteCalls for backward compat
- Update OrganizationsSection.cs Clients property to use new section type
- Update MerakiClient.cs to wire up all three client interfaces

Agent-Logs-Url: https://github.com/panoramicdata/Meraki.Api/sessions/20dfd578-4d0e-48ec-ab9d-98478d1a1b16

Co-authored-by: danielabbatt <8926756+danielabbatt@users.noreply.github.com>
Copilot AI changed the title [WIP] Add endpoint for searching organization clients Wire up organization client endpoints into OrganizationsClientsSection Apr 4, 2026
Copilot AI requested a review from danielabbatt April 4, 2026 17:38
@danielabbatt danielabbatt marked this pull request as ready for review April 12, 2026 19:24
Copilot AI review requested due to automatic review settings April 12, 2026 19:24
@danielabbatt danielabbatt merged commit f7e1d24 into main Apr 12, 2026
4 of 5 checks passed
@danielabbatt danielabbatt deleted the copilot/add-search-functionality-for-clients branch April 12, 2026 19:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Wires previously-unreachable organization client-related endpoints into the MerakiClient/OrganizationsSection hierarchy by introducing a dedicated OrganizationsClientsSection, aligning the Organizations “clients” surface with the existing Networks pattern.

Changes:

  • Added OrganizationsClientsSection to group client search, overview, and bandwidth usage history endpoints.
  • Updated OrganizationsSection.Clients to expose the new OrganizationsClientsSection.
  • Updated MerakiClient constructor wiring to initialize the new nested client interfaces.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
Meraki.Api/Sections/General/Organizations/OrganizationsSection.cs Exposes Clients as a section (instead of a flat interface) to match other section hierarchies.
Meraki.Api/Sections/General/Organizations/OrganizationsClientsSection.cs New section grouping the three organization client interfaces, promoting calls for the legacy search interface.
Meraki.Api/MerakiClient.cs Wires up the new section’s interfaces (Clients, Overview, BandwidthUsageHistory) via Refit.

Comment on lines 77 to +80
/// <summary>
/// Interface for client search and details.
/// Section for client search and details.
/// </summary>
public IOrganizationsClients Clients { get; internal set; } = null!;
public OrganizationsClientsSection Clients { get; internal set; } = new();
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing OrganizationsSection.Clients from IOrganizationsClients to OrganizationsClientsSection is a public API signature change. [RefitPromoteCalls] preserves method-call syntax, but consumers that reference the property as IOrganizationsClients (e.g., assignments/DI registrations/method params) will no longer compile. If the intent is truly non-breaking, consider keeping a public IOrganizationsClients-typed property (possibly obsolete) or having OrganizationsClientsSection implement IOrganizationsClients so it remains assignable to the interface; otherwise this should be treated/documented as a breaking change (SemVer/changelog).

Copilot uses AI. Check for mistakes.

/// <summary>
/// Interface for client search and details.
/// Section for client search and details.
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The XML doc for OrganizationsSection.Clients still describes only “client search and details”, but this section now also exposes Overview and BandwidthUsageHistory endpoints. Update the summary to reflect the full scope to avoid misleading IntelliSense for consumers.

Suggested change
/// Section for client search and details.
/// Section for client search, details, overview, and bandwidth usage history operations.

Copilot uses AI. Check for mistakes.
Comment on lines +153 to +158
Clients = new()
{
Clients = RefitFor(Organizations.Clients.Clients),
BandwidthUsageHistory = RefitFor(Organizations.Clients.BandwidthUsageHistory),
Overview = RefitFor(Organizations.Clients.Overview),
},
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New public surface area is being wired (Organizations.Clients.Overview and .BandwidthUsageHistory), but there are no corresponding tests exercising these endpoints (only GetOrganizationClientsSearchAsync is covered). Consider adding integration tests alongside Meraki.Api.Test/Organizations/Clients/Tests.cs to ensure these newly exposed interfaces remain correctly wired and callable.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to search all organization clients

3 participants